/**
 * 
 * @class Tm.common.form.ColumnLayoutFieldSet
 * @extends Ext.form.FieldSet
 */
Ext.ns('Tm.common.view');
Tm.common.view.ColumnLayoutFieldSet = Ext.extend(Ext.form.FieldSet, {
	/**
	 * @cfg 使用ColumnLayout
	 * @type String
	 */
	layout: 'column'
	/**
	 * @cfg 可展开/收起
	 * @type Boolean
	 */
	,collapsible: true
	
	/**
	 * @cfg 默认的输入框类型
	 * @type String
	 */
	,defaultFieldType: 'combo'
	
	/**
	 * 是否隐藏左，右，底部的边框
	 * @type Boolean
	 */
	,hideLRBBorders: true

	
	/**
	 * @cfg {Array} items
	 * 
	 * 
	 */
	
	/**
	 * initComponent
	 */
	,initComponent: function(){
		if (this.hideLRBBorders){
			this.style =  'border-left-color: transparent;' +
				'border-right-color: transparent;' +
				'border-bottom-color: transparent;';
		}
		var sourceItems = this.items || [],
			i,
			n = sourceItems.length,
			columnWidth = 1/n,
			defaultType = this.defaultFieldType;
		
		for (i = 0; i < n; i++){
			Ext.apply(sourceItems[i],
			{
				columnWidth: columnWidth
				,layout: 'form'
			//	,labelAlign: 'top'
				,defaultType: defaultType
				,defaults: {anchor: '90%'}
			});
		}
		
		Tm.common.view.ColumnLayoutFieldSet.superclass.initComponent.call(this);
	}
});

Ext.reg('clfieldset', Tm.common.view.ColumnLayoutFieldSet);
